package com.yuanfeng.commoms.exception;


import com.yuanfeng.commoms.util.ResponseResult;

public enum GlobalExceptionEnum {
	SYSTEM_ERROR(2, "系统异常，请联系客服"), 
	MYSQL_EXCEPTION(8002, "数据库sql异常"),
	BLOCKING_EXCEPTION(8003, "网络有点不顺畅，小蜂君正在快马加鞭的路上~"),
	SMS_EXCEPTION(8004, "短信发送失败，请稍后再试"),
	MYSQL_EXCEPTION_DATA_DUPLICATION(8005, "数据库中数据重复"),
	NO_FORBIDDEN(10086, "登录失败，请重新登录")
	;

	private Integer errorCode;

	private String errorMsg;

	public Integer getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(Integer errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	private GlobalExceptionEnum(Integer errorCode, String errorMsg) {
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}

	private GlobalExceptionEnum() {
	}

	public ResponseResult getResult(Integer errorCode, String errorMsg) {
		return  ResponseResult.fail(errorCode,errorMsg);
	}

}
